GNFORCEINLINE void GnOutputDebugString(const gtchar* outString)
{
	OutputDebugString(outString);
}

inline void GnLogger::SetUseLogger(gtchar* name)
{
	msSingletone->mUseLoggerList.push_back( name );
}

inline void GnLogger::SetOutputDebug(const gtchar* logerName)
{
	mAppenOutputDebug( APPEND_WIN32DEBUG, logerName );
}

inline void GnLogger::SetOutputFile(const gtchar* logerName, const gtchar* filename, long maxFileSize,
	int maxBackupIndex, bool immediateFlush)
{
	mAppendFile( APPEND_WIN32DEBUG, logerName, filename, maxFileSize, maxBackupIndex, immediateFlush );
}

GNFORCEINLINE  void GnLogger::WriteLog(const gtchar* format, ...)
{
	va_list kArgs;
	va_start( kArgs, format );
	Write( DEBUGEXT, log4cplus::DEBUG_LOG_LEVEL, format, kArgs );
	va_end( kArgs );
}

GNFORCEINLINE  void GnLogger::WriteError(const gtchar* format, ...)
{
	va_list kArgs;
	va_start( kArgs, format );
	Write( ERRORTEXT, log4cplus::ERROR_LOG_LEVEL, format, kArgs );
	va_end( kArgs );
}

GNFORCEINLINE  void GnLogger::WriteWarring(const gtchar* format, ...)
{
	va_list kArgs;
	va_start( kArgs, format );
	Write( WARINGTEXT, log4cplus::ERROR_LOG_LEVEL, format, kArgs );
	va_end( kArgs );
}

GNFORCEINLINE  void GnLogger::WriteAlways(const gtchar* logName, const gtchar* format, ...)
{
	va_list kArgs;
	va_start( kArgs, format );
	Write( logName, log4cplus::ERROR_LOG_LEVEL, format, kArgs );
	va_end( kArgs );
}

inline void GnLogger::SetUseFileLog(bool useLog)
{
	SetBit(useLog, USE_FILELOG_MASK);
}
inline bool GnLogger::GetUseFileLog()
{
	return GetBit(USE_FILELOG_MASK);
}
inline void GnLogger::SetUseOutputDebug(bool useLog)
{
	SetBit(useLog, USE_OUTPUTDEBUG_MASK);
}
inline bool GnLogger::GetUseOutputDebug()
{
	return GetBit(USE_OUTPUTDEBUG_MASK);
}

GNFORCEINLINE void GnLogger::LineCheck( gtchar* message, gsize& messageLength )
{
	if (message[messageLength-1] != '\n')
	{
		message[messageLength] = '\n';
		message[messageLength+1] = NULL;
	}
	else
	{
		message[messageLength] = NULL;
	}
}